require "utils.preload"
require "global.importd"
require "global.threadd"
require "global.serviced"
require "global.consoled"
require "global.timerd"

---! 设置日志输出等级
spdlog.set_level(spdlog.level.debug)
spdlog.trace_enable("data", 0)
spdlog.trace_enable("combat", 1)

local tick = os.clock()
load_all("channel")
load_all("feature")
load_all("inherit")
load_all("object")
load_all("daemon")
load_all("cmd")
local cost = os.clock() - tick
spdlog.debug("service", "Load all files OK. cost total tick = %s", cost)

---! 加载游戏配置
IMPORT_D:load("databin.json")

spdlog.debug("service", "start post init ...")
local tick = os.clock()
post_init()
local cost = os.clock() - tick
spdlog.debug("service", "finish init cost tick = %s", cost)

SERVICE_D:mainloop()
